<template>
<div>
  <van-cell-group inset style="display: flex; justify-content: space-around;">
    <van-button type="primary" @click="w1">跨端浏览</van-button>
    <van-button type="primary" @click="w2">vant页面重构1</van-button>
    <van-button type="primary" @click="w3">vant页面重构2</van-button>
  </van-cell-group>
  <router-view />
</div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { onMounted } from 'vue'
const router = useRouter()


const w1 = () =>{
  router.replace('/workfirst')
}
const w2 = () =>{
  router.replace('/study')
}
const w3 = () =>{
  router.replace('/person')
}
onMounted(() => {
  window.addEventListener('beforeunload', () => {
    // 刷新时重置路由路径
    router.replace('/todolist/dist/index.html');
  });
});
</script>